package net.skyaims.iptv.web;

import net.skyaims.iptv.domain.StarInfo;
import net.skyaims.iptv.persist.tv.StarInfoMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@Component
public class StarController {

	private StarInfoMapper starInfoMapper;

	@Autowired
	@Required
	public void setStarInfoMapper(StarInfoMapper starInfoMapper) {
		this.starInfoMapper = starInfoMapper;
	}

	@RequestMapping(value = "/star/{starId}", method = RequestMethod.GET)
	public @ResponseBody
	StarInfo getStarById(@PathVariable("starId") Long starId) {
		return this.starInfoMapper.getById(starId);
	}

}
